﻿/*
 * Copyright (c) 2009, 北京理工大学  王柳茗
 * All rights reserved.
 *
 * $Revision$
 *
 * $Author$
 *
 * $Date$
 *
 * $Log$
 *
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace wlm.wsx
{
    /// <summary>
    /// 
    /// </summary>
    public class PlusOperator:Operator 
    {
        /// <summary>
        /// <operator type="+">
        ///     <int>1</int>
        ///     <int>2</int>
        /// </operator>
        /// </summary>
        public PlusOperator():base("+")
        {
        }
        /// <summary>
        /// 两参数构造函数
        /// </summary>
        /// <param name="op1">第一个操作数</param>
        /// <param name="op2">第二个操作数</param>
        public PlusOperator(int op1, int op2):base("+")
        {
            _Operant1 = op1;
            _Operant2 = op2;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToXML()
        {
            int sum = _Operant1 + _Operant2;
            return "<int>" + sum + "</int>";
        }
        private int _Operant1 = 0;
        private int _Operant2 = 0;
    }
}
